/*
 * @Author: huangyq
 * @Date: 2022-03-31 14:57:36
 * @LastEditTime: 2022-06-14 13:40:05
 * @LastEditors: huangyq
 * @Description: your description
 * @FilePath: /vue3-boilerplate-pc-client/src/routers/routes.ts
 */

import { RouteRecordRaw } from 'vue-router'
import configCenter from './sub-menus/configCenter'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'root',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue')
  },
  {
    path: '/pages',
    name: 'pages',
    component: () => import('@/views/pages/index.vue'),
    redirect: '/dashboard',
    meta: {
      title: '主页'
    },
    children: [
      {
        path: '/dashboard',
        name: 'dashboard',
        component: () => import('@/views/pages/dashboard/index.vue'),
        meta: {
          code: '000',
          title: 'welcome'
        }
      },
      {
        path: '/error403',
        name: 'error403',
        component: () => import('@/views/pages/error403/index.vue'),
        meta: {
          code: '000',
          title: '无权访问'
        }
      },
      {
        path: '/error404',
        name: 'error404',
        component: () => import('@/views/pages/error404/index.vue'),
        meta: {
          code: '000',
          title: 'not found'
        }
      },
      {
        path: '/config-center',
        name: 'config-center',
        component: () => import('@/views/pages/config-center/index.vue'),
        meta: {
          code: '000',
          title: '配置中心',
          sidebar: true,
          icon: 'qt-icon-yonghu'
        },
        children: configCenter
      }
    ]
  }
]

export default routes
